package com.chinasofti.controluser.controller;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.chinasofti.controlcommon.common.ServerResponse;
import com.chinasofti.controlcommon.domain.entity.SysUser;
import com.chinasofti.controluser.service.ControlUserService;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
public class UserController {
	
	@Autowired
	private ControlUserService controlUserService;
	
	/**
     * 新增用户
     */
    @PostMapping("/addUser")
    public ServerResponse addUser(@RequestBody SysUser user) {
		return controlUserService.addUser(user);
    	
    }
    
    /**
     * 修改用户
     */
    @PostMapping("/updateUser")
    public ServerResponse updateUser(@RequestBody SysUser user) {
    	return controlUserService.updateUser(user);
    }
    
    /**
     * 删除用户(支持批量删除)
     */
    @PostMapping("/deleteUser")
    public ServerResponse deleteUser(@RequestBody List<String> id) {
		return controlUserService.deleteUser(id);
    	
    }
}
